package com.cloud.rapid.user.service.impl;

import com.baomidou.mybatisplus.extension.service.impl.ServiceImpl;
import com.cloud.rapid.user.entity.SysUser;
import com.cloud.rapid.user.mapper.SysUserMapper;
import com.cloud.rapid.user.service.SysUserService;
import lombok.extern.slf4j.Slf4j;
import org.springframework.stereotype.Service;

import java.util.*;

/**
 * 用户
 */
@Slf4j
@Service
public class SysUserServiceImpl extends ServiceImpl<SysUserMapper, SysUser> implements SysUserService {

    /**
     * 通过查用户的全部信息
     *
     * @return
     */
    @Override
    public List<SysUser> getUserInfo() {
        List<SysUser> data = this.list();
        return data;
    }

    /**
     * 修改用户
     *
     * @param id
     * @param name
     */
    @Override
    public void updateUserById(String id, String name) {
        SysUser data = this.getById(id);
        data.setName(name);
        this.updateById(data);
    }
}
